package com.example.qxfw.backgroundManagement.service.impl;

import com.example.qxfw.backgroundManagement.mapper.UserManagementFirstMapper;
import com.example.qxfw.backgroundManagement.mapper.UserManagementSecondMapper;
import com.example.qxfw.backgroundManagement.service.UserManagerSecondService;
import com.example.qxfw.common.entity.Roles;
import com.example.qxfw.common.entity.UserTable;
import com.example.qxfw.common.entity.ny.StationInfo;
import com.example.qxfw.common.entity.xt.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/************************************
 *
 * @author : HuangDeYin Jolly
 * @since : JDK 11
 * @Date : 2023/7/4  星期二   23:36
 * @description : 此类用来 用户管理模块2
 ***************************************/
@Service
public class UserManagerSecondServiceImpl implements UserManagerSecondService {

    @Autowired
    private UserManagementSecondMapper userManagementSecondMapper;

    @Autowired
    private UserManagementFirstMapper userManagementFirstMapper;

    @Override
    public List<UserTable> selectUserTable() {
        List<UserTable> userTables = this.userManagementSecondMapper.selectUserTable();
        return userTables;
    }

    @Override
    public List<Roles> selectAll() {
        List<Roles> roles = this.userManagementSecondMapper.selectRoles();
        return roles;
    }

    @Override
    public List<StationInfo> selectStationInfo() {
        List<StationInfo> stationInfos = this.userManagementSecondMapper.selectStationInfo();
        return stationInfos;
    }

    @Override
    public List<UserTable> selectUserTableByUserName(final String userName) {
        List<UserTable> userTables = this.userManagementSecondMapper.selectByUserName(userName);
        return userTables;
    }

    @Override
    public Integer insertUserTable(final UserTable userTable) {
        Integer insertUserTable = this.userManagementSecondMapper.insertUserTable(userTable);
        return insertUserTable;
    }

    @Override
    public List<Users> selectByUserNameAndType(final String username, final String type) {
        List<Users> usersList = this.userManagementSecondMapper.selectByUserNameAndType(username, type);
        return usersList;
    }

    @Override
    public Integer updateUsers(final Users users) {
        Integer updateUsers = this.userManagementSecondMapper.updateUsers(users);
        return updateUsers;
    }

    @Override
    public Integer insertUsers(final Users users) {
        Integer insertUsers = this.userManagementSecondMapper.insertUsers(users);
        return insertUsers;
    }

    @Override
    public List<Users> selectUsersByUsername(final String username) {
        List<Users> usersList = this.userManagementSecondMapper.selectUsersByUsername(username);
        return usersList;
    }

    @Override
    public Integer deleteUsers(final String username) {
        Integer deleteUsers = this.deleteUsers(username);
        return deleteUsers;
    }

    @Override
    public Integer updateUserTable(final UserTable userTable) {
        Integer updateUserTable = this.userManagementSecondMapper.updateUserTable(userTable);
        return updateUserTable;
    }

    @Override
    public Integer deleteUserTable(final String username) {
        Integer deleteUserTable = this.userManagementFirstMapper.deleteUserTable(username);
        return deleteUserTable;
    }

    @Override
    public List<UserTable> querySelect(final String starttime, final String endtime, final String username) {
        List<UserTable> userTableList = this.userManagementSecondMapper.querySelect(starttime, endtime, username);
        return userTableList;
    }
}
